import common.common_util
import pytest
def read_yaml():
    return ['chenglong','zzd','cyl']

@pytest.fixture(scope='function',autouse=False,params=read_yaml()) #部分前后置   yield 后置
def exe_database_sql(request):
    print('执行sql查询')
    # print(request.param)
    # return '123'
    yield request.param
    print('关闭数据库链接')
class TestCase():
# class TestCase(common.common_util.changyong):
    # workage = 8
    # @pytest.mark.smoke
    def test_01(self):
        print('测试01')
        assert 1==1
    # @pytest.mark.skip(reason='无理由')
    def test_02(self):
        print('测试02')
        assert  'a' in 'abc'
        # raise Exception('测试翻车')
    # @pytest.mark.skipif(workage<10,reason='工龄不够')
    def test_03(self,exe_database_sql):

        print('测试03:'+exe_database_sql)
        # print(exe_database_sql)
        # raise Exception('测试翻车')
# @pytest.mark.usefixtures('exe_database_sql')
# class Test_edu:
#     def test_04(self):
#         print('mashang')
